<html>
<head><meta charset="utf-8"><title>unwind option · project-inline-asm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/index.html">project-inline-asm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html">unwind option</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="238802239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238802239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cynecx <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238802239">(May 14 2021 at 17:35)</a>:</h4>
<p>Support for unwinding from inline assembly has landed in upstream llvm. I am currently looking into integrating this support into rustc. I was wondering if this fits into the scope of the<code>inline-asm</code>project?</p>



<a name="238804300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238804300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238804300">(May 14 2021 at 17:49)</a>:</h4>
<p>Nice! Do you have a link for more information upstream?</p>



<a name="238804309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238804309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238804309">(May 14 2021 at 17:49)</a>:</h4>
<p>I think we might need to wait for LLVM 13 for this.</p>



<a name="238804422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238804422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238804422">(May 14 2021 at 17:50)</a>:</h4>
<p>The problem is that the upstream change involves changes to LLVM bitcode, which would break cross-language LTO with Clang 12.</p>



<a name="238804553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238804553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238804553">(May 14 2021 at 17:51)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> <a href="https://reviews.llvm.org/D95745">https://reviews.llvm.org/D95745</a></p>



<a name="238804573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238804573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238804573">(May 14 2021 at 17:51)</a>:</h4>
<p><span class="user-mention silent" data-user-id="143274">Amanieu</span> <a href="#narrow/stream/216763-project-inline-asm/topic/unwind.20option/near/238804422">said</a>:</p>
<blockquote>
<p>The problem is that the upstream change involves changes to LLVM bitcode, which would break cross-language LTO with Clang 12.</p>
</blockquote>
<p>Ah, good to know. Would that affect code <em>not</em> using unwinding from asm? Or would that only break if someone actually used an asm that they added an unwind option to?</p>



<a name="238804616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238804616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cynecx <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238804616">(May 14 2021 at 17:51)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> <a href="https://reviews.llvm.org/rG8ec9fd483949ca3b23053effcac226dcc56e7a95">https://reviews.llvm.org/rG8ec9fd483949ca3b23053effcac226dcc56e7a95</a> :)</p>
<p><span class="user-mention" data-user-id="143274">@Amanieu</span> Oh, that's unfortunate. I was asking over wg-llvm the same thing.</p>



<a name="238804795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238804795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238804795">(May 14 2021 at 17:53)</a>:</h4>
<p>All <code>inlineasm</code> are changed to use a new opcode: <a href="https://reviews.llvm.org/D95745#change-ktOU8md1VSZi">https://reviews.llvm.org/D95745#change-ktOU8md1VSZi</a></p>



<a name="238805561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238805561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238805561">(May 14 2021 at 17:59)</a>:</h4>
<p>Ah. :(</p>



<a name="238805687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238805687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238805687">(May 14 2021 at 18:00)</a>:</h4>
<p>I don't know enough about how LLVM bitcode works; is it possible to still use the old opcode with new LLVM, for compatibility?</p>



<a name="238806241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238806241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238806241">(May 14 2021 at 18:03)</a>:</h4>
<p>Possibly, but I would still feel uncomfortable with backporting this feature.</p>



<a name="238808535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238808535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238808535">(May 14 2021 at 18:19)</a>:</h4>
<p>Sure. I'm not necessarily suggesting backporting this. I'm more trying to find out if it's going to break backwards compatibility with older LLVM if we start supporting it in the future.</p>



<a name="238808639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238808639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238808639">(May 14 2021 at 18:19)</a>:</h4>
<p>No, it shouldn't break backward compatibility. You won't be able to mark your <code>asm!</code> as <code>unwind</code> with older LLVM, but that's it.</p>



<a name="238808738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238808738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238808738">(May 14 2021 at 18:20)</a>:</h4>
<p>And we only support cross-lang LTO with a Clang of the same LLVM version as us.</p>



<a name="238808793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/238808793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#238808793">(May 14 2021 at 18:20)</a>:</h4>
<p><span class="user-mention silent" data-user-id="143274">Amanieu</span> <a href="#narrow/stream/216763-project-inline-asm/topic/unwind.20option/near/238808639">said</a>:</p>
<blockquote>
<p>No, it shouldn't break backward compatibility. You won't be able to mark your <code>asm!</code> as <code>unwind</code> with older LLVM, but that's it.</p>
</blockquote>
<p>That's what I was wondering. Perfect.</p>



<a name="247813735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/247813735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cynecx <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#247813735">(Jul 31 2021 at 16:45)</a>:</h4>
<p>I am going to pick this up very soon when <a href="https://github.com/rust-lang/rust/pull/87570">https://github.com/rust-lang/rust/pull/87570</a> lands :)</p>



<a name="247814710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/unwind%20option/near/247814710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/unwind.20option.html#247814710">(Jul 31 2021 at 17:09)</a>:</h4>
<p>Sounds great!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>